package com.example.order.domain.dto;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class GoodsDTO {

   @NotNull(message = "数量不能为空")
   @Min(value = 1, message = "数量最小为1")
   @Max(value = 9999, message = "数量最大为9999")
   private Integer num;

   @NotNull(message = "商品id不能为空")
   private Long itemId;

   @NotNull(message = "规格不能为空")
   private String spec;

   @NotNull(message = "商品价格不能为空")
   private BigDecimal price;

   @NotNull(message = "商品名称不能为空")
   private String name;

   @NotNull(message = "商品图片不能为空")
   private String image;
}
